/**
 * 三、string方法
 */
/**
 一、属性
     String length
二、方法
    String.prototype[@@iterator]()
    String.prototype.anchor()         //dom
    String.prototype.at([index])      //获取字符
(en-US)
    String.prototype.big()            //dom
    String.prototype.blink()
    String.prototype.bold()           //dom
    String.prototype.charAt(index)    //获取字符
    String.prototype.charCodeAt()
    String.prototype.codePointAt()    
    String.prototype.concat()         //字符串拼接 
    String.prototype.endsWith()
    String.prototype.fixed()
    String.prototype.fontcolor()
    String.prototype.fontsize()
    String.fromCharCode()
    String.fromCodePoint()

--  String.prototype.includes()      //returning true or false as appropriate.
--  String.prototype.indexOf()

    String.prototype.italics()

--- String.prototype.lastIndexOf()

    String.prototype.link()
    String.prototype.localeCompare()

---  String.prototype.match()
---  String.prototype.matchAll()

    String.prototype.normalize()
    String.prototype.padEnd()
    String.prototype.padStart()

--- String.raw()
    String.prototype.repeat()

--- String.prototype.replace()
--- String.prototype.replaceAll()
--- String.prototype.search()
--- String.prototype.slice()
    
    String.prototype.small()

---    String.prototype.split()
    String.prototype.startsWith()
    String.prototype.strike()

       String.prototype.sub()    // creates a <sup> HTML element 
---    String.prototype.substr()
---    String.prototype.substring()
String.prototype.sup()
String.prototype.toLocaleLowerCase()
String.prototype.toLocaleUpperCase()
String.prototype.toLowerCase()
String.prototype.toSource()
--- String.prototype.toString()
String.prototype.toUpperCase()
String.prototype.trim()
String.prototype.trimEnd()
String.prototype.trimStart()
String.prototype.valueOf()
 */
/**1、字符串翻转**/ 
let str = "1234567890"
console.log(str.split("").reverse().join("")) //0987654321
/**2、字符串分割**/ 
const str2 = "java-html-css-by-id"
const splitArr = str2.split("-")
console.log("splitArr:", splitArr) //splitArr: (5) ['java', 'html', 'css', 'by', 'id']
/**3、字符串首字母大写**/ 
for (let i = 0; i < splitArr.length; i++) {
    splitArr[i] = splitArr[i].charAt(0).toUpperCase() + splitArr[i].substr(1, splitArr[i].length - 1);
}
console.log("splitArr:", splitArr) //splitArr: (5)  ['Java', 'Html', 'Css', 'By', 'Id']
/**4、数组转字符串**/ 
const str3 = splitArr.join("|")
console.log("str3:", str3) //str3: Java|Html|Css|By|Id
/**5、toLocaleUpperCase()**/ 
const str4 = 'abcdefg'
console.log("toLocaleLowerCase:", str4.toLocaleUpperCase())//ABCDEFG【返回新串】
const str5 = 'ABCDEFG'
/**6、toLocaleLowerCase()**/ 
console.log("str5.toLocaleLowerCase:", str5.toLocaleLowerCase())//abcdefg